﻿using System.Collections.Generic;

namespace Chevron.OrderDetails.Models
{
    public class TestCategory
    {
        public string Name { get; set; }

        public ReferalType ReferalType { get; set; }

        public decimal ReferalAmount { get; set; }

        public static TestCategory Deserialize(string data)
        {
            List<string> fields = Utilities.AlaSplitFields(data, ',');
            return new TestCategory
                       {
                           Name = fields[0],
                           ReferalType = fields[1].ToReferalType(),
                           ReferalAmount = fields[2].ToDecimal()
                       };
        }
    }
}